﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using WebChatApi.Common.Interface;
using WebChatApi.Common.LightAccessControl;

namespace WebChatApi.Common
{
    /// <summary>
    /// Generic class for base service request
    /// </summary>
    [DataContract]
    [KnownType(typeof(AccessLicense))]
    public class AccessLicenseBasedServiceRequest<T> : IAccessLicenseBasedServiceRequest, IIdentifiable
    {
        #region Properties

        /// <summary>
        /// Gets the key.
        /// </summary>
        /// <value>The key.</value>
        [DataMember]
        public Guid Key
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the session info.
        /// </summary>
        /// <value>
        /// The session info.
        /// </value>
        [DataMember]
        public AccessLicense AccessLicense
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the culture code.
        /// </summary>
        /// <value>The culture code.</value>
        [DataMember]
        public string CultureCode
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the request detail.
        /// </summary>
        /// <value>
        /// The request detail.
        /// </value>
        [DataMember]
        public T RequestDetail
        {
            get;
            set;
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="AccessLicenseBasedServiceRequest{T}"/> class.
        /// </summary>
        public AccessLicenseBasedServiceRequest()
        {
            this.Key = Guid.NewGuid();
        }

        #endregion
    }
}
